/**
 * VISA 工具包头文件
 */

#pragma once

#include <string.h>
#include "transceiver.h"

static inline std_err_t VISACMD(transceiver_t *trx, const char *cmd) {
	return trx->tx(trx, cmd, strlen(cmd), NULL);
}

static inline rx_ret_t VISACMDACK(transceiver_t* trx, const char* cmd, char *rxbuf, size_t rxbuf_size, size_t timeout, const char *okFlag, rx_flag_t okFlagType) {
	std_err_t err = trx->tx(trx, cmd, strlen(cmd), NULL);
	if (err) return err;
	return trx->rx(trx, rxbuf, rxbuf_size, NULL, timeout, 0, okFlag, okFlagType, NULL, RX_FLAG_NULL);
}

transceiver_t* visatrx_open(const char* addr);
